• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Consuming .NET webservice

New Here ,
Jun 09, 2008 Jun 09, 2008

Copy link to clipboard

Copied

I have a webservice that I have to push data to. I am not a .NET guys and cannot translate this to ColdFusion very well. Here is an example of C# code provided. Attached on the bottom.

Now...
I've created following...
<cfset ws = Createobject("webservice","https://url")>
<cfscript>
sOrder.CustomerId = 1;
sOrder.OrderStatus = "Incomplete";
sOrder.OrderDate = DateFormat(now(), "yyyy-mm-dd") & "T" & TimeFormat(now(), "HH:mm:ss") & "Z";
sOrder.CurrencyCode = "USD";
sOrder.WarehouseID = "1";
sOrder.ShipMethodId = "2";
sOrder.PriceType = 1;
sOrder.FirstName = "misha";
sOrder.LastName = "misha";
sOrder.Company = "a";
sOrder.Address1 = "address1";
sOrder.Address2 = "address2";
sOrder.City = "sj";
sOrder.State = "CA";
sOrder.Zip = "33333";
sOrder.Country = "US";
sOrder.County = "a";
sOrder.Email = "test@test.com";
sOrder.Phone = "555-555-5555";
sOrder.Notes = "a";
sOrder.details = ArrayNew(1);
sOrder.details[1] = StructNew();
sOrder.details[1].ItemCode = "code1";
sOrder.details[1].Quantity = 1;
sOrder.details[2] = StructNew();
sOrder.details[2].ItemCode = "code2";
sOrder.details[2].Quantity = 1;
ws.CreateOrder(sOrder);
</cfscript>

This code throws an error
Web service operation CreateOrder with parameters {parameters here} cannot be found.

What am I missing?
TOPICS
Advanced techniques

Views

262

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 09, 2008 Jun 09, 2008

Copy link to clipboard

Copied

Whenever I get that specific error it's because I failed to send one of the arguments. And, for the record, if you make a cfc a ws, 100% of the arguments are mandatory, irrespective of what your cfargument tags say.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 10, 2008 Jun 10, 2008

Copy link to clipboard

Copied

LATEST
I am sure I'm passing everything to what ws is requiring. Here is a part of wsdl
<s:extension base="tns:BaseCalculateOrderRequest">
−
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CustomerID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="Frequency" type="tns:FrequencyType"/>
<s:element minOccurs="1" maxOccurs="1" name="StartDate" type="s:dateTime"/>
<s:element minOccurs="0" maxOccurs="1" name="CurrencyCode" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="WarehouseID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="ShipMethodID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="PriceType" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="PaymentType" type="tns:AutoOrderPaymentType"/>
<s:element minOccurs="0" maxOccurs="1" name="FirstName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="LastName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Company" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="City" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="State" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Zip" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Country" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="County" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Email" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Phone" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Notes" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Details" type="tns:ArrayOfOrderDetailRequest"/>
</s:sequence>
</s:extension>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation