I'm using Fedex's WSDL in C# to generate COD shipping labels. On Fedex shipping labels there is an "Invoice #" string on both the shipping label and the COD return label. I want to set my orderid in the request to Fedex such that my orderid shows up as the Invoice #.
It's not obvious to me how to set the Invoice # in Fedex's wsdl request. Has anybody done this?
The way in which you place the order id or invoice number in the labels is following:
Set the invoice number in the package customer reference.
Specify on the COD details node (on the reference indicator) that you want the COD label to include the invoice number as one of its reference.
Please, note that you can also include other references than invoice number (e.g.: PO, customer reference, and tracking).
Here is a sample SOAP envelope for the request depicting what I said before:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ProcessShipmentRequest xmlns="http://fedex.com/ws/ship/v12">
<WebAuthenticationDetail>
<CspCredential>
<Key>CSP_KEY(IF YOU ARE ONE)</Key>
<Password>CIS_PASSWORD(IF YOU ARE ONE)</Password>
</CspCredential>
<UserCredential>
<Key>CSP_USER_KEY(IF YOU BELONG TO THE CSP)</Key>
<Password>CSP_PASSWORD(IF YOU BELONG TO THE CSP)</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>ACCOUNT_NUMBER</AccountNumber>
<MeterNumber>METER_NUMBER</MeterNumber>
<ClientProductId>CLIENT_PRODUCT_ID(IF ONE IS PROVIDED)</ClientProductId>
<ClientProductVersion>CLIENT_VERSION(IF ONE IS PROVIDED)</ClientProductVersion>
</ClientDetail>
<TransactionDetail>
<CustomerTransactionId>261</CustomerTransactionId>
</TransactionDetail>
<Version>
<ServiceId>ship</ServiceId>
<Major>12</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<RequestedShipment>
<ShipTimestamp>2013-08-21T14:00:00-04:00</ShipTimestamp>
<DropoffType>REGULAR_PICKUP</DropoffType>
<ServiceType>PRIORITY_OVERNIGHT</ServiceType>
<PackagingType>YOUR_PACKAGING</PackagingType>
<Shipper>
<AccountNumber>ACCOUNT_NUMBER</AccountNumber>
<Contact>
<PersonName>323199 323199</PersonName>
<CompanyName>CSP Testing</CompanyName>
<PhoneNumber>9012633035</PhoneNumber>
<EMailAddress>csp#fedex.com</EMailAddress>
</Contact>
<Address>
<StreetLines>99 Fedex parkway</StreetLines>
<City>ALAMEDA</City>
<StateOrProvinceCode>CA</StateOrProvinceCode>
<PostalCode>94501</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Shipper>
<Recipient>
<Contact>
<PersonName>323257 323257</PersonName>
<CompanyName>CSP Testing</CompanyName>
<PhoneNumber>9012633035</PhoneNumber>
<EMailAddress>csp#fedex.com</EMailAddress>
</Contact>
<Address>
<StreetLines>124 Fedex parkway</StreetLines>
<City>PADUCAH</City>
<StateOrProvinceCode>KY</StateOrProvinceCode>
<PostalCode>42001</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Recipient>
<Origin>
<Contact>
<PersonName>323199 323199</PersonName>
<CompanyName>CSP Testing</CompanyName>
<PhoneNumber>9012633035</PhoneNumber>
<EMailAddress>csp#fedex.com</EMailAddress>
</Contact>
<Address>
<StreetLines>99 Fedex parkway</StreetLines>
<City>ALAMEDA</City>
<StateOrProvinceCode>CA</StateOrProvinceCode>
<PostalCode>94501</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Origin>
<ShippingChargesPayment>
<PaymentType>SENDER</PaymentType>
<Payor>
<ResponsibleParty>
<AccountNumber>ACCOUNT_NUMBER</AccountNumber>
<Contact>
<PersonName>CSP Testing</PersonName>
<CompanyName>RTC Testing</CompanyName>
</Contact>
<Address>
<CountryCode>US</CountryCode>
</Address>
</ResponsibleParty>
</Payor>
</ShippingChargesPayment>
<SpecialServicesRequested>
<SpecialServiceTypes>COD</SpecialServiceTypes>
<CodDetail>
<CodCollectionAmount>
<Currency>USD</Currency>
<Amount>50</Amount>
</CodCollectionAmount>
<CollectionType>ANY</CollectionType>
<ReferenceIndicator>INVOICE</ReferenceIndicator>
</CodDetail>
</SpecialServicesRequested>
<CustomsClearanceDetail>
<DocumentContent>NON_DOCUMENTS</DocumentContent>
</CustomsClearanceDetail>
<LabelSpecification>
<LabelFormatType>COMMON2D</LabelFormatType>
<ImageType>PNG</ImageType>
<LabelStockType>PAPER_4X6</LabelStockType>
</LabelSpecification>
<RateRequestTypes>ACCOUNTACCOUNT</RateRequestTypes>
<PackageCount>1</PackageCount>
<RequestedPackageLineItems>
<SequenceNumber>1</SequenceNumber>
<GroupPackageCount>1</GroupPackageCount>
<InsuredValue>
<Currency>USD</Currency>
<Amount>5000</Amount>
</InsuredValue>
<Weight>
<Units>LB</Units>
<Value>20</Value>
</Weight>
<PhysicalPackaging>OTHER</PhysicalPackaging>
<ItemDescription>MacBook Pro</ItemDescription>
<CustomerReferences>
<CustomerReferenceType>INVOICE_NUMBER</CustomerReferenceType>
<Value>INVOICE12345</Value>
</CustomerReferences>
<SpecialServicesRequested>
<SpecialServiceTypes>SIGNATURE_OPTION</SpecialServiceTypes>
<SignatureOptionDetail>
<OptionType>SERVICE_DEFAULT</OptionType>
</SignatureOptionDetail>
</SpecialServicesRequested>
</RequestedPackageLineItems>
</RequestedShipment>
</ProcessShipmentRequest>
</soap:Body>
</soap:Envelope>
This is the generated shipping label:
This is the generated COD label:
I hope my reply is of help to you.
Best!
Related
Not sure if anyone has had this issue with UPS's xml api request sample but I am trying to post an xml request to receive UPS rates. I am using their request example which I have posted below. However, this is not a valid xml document because it has more than one root tag, but if I post this to UPS it goes through fine.
What to do about this? Do I need to do some C# hacking to make this work? I am at a loss.
Why would UPS give an invalid example to use for their api? Any help would be great. Thanks.
<?xml version="1.0"?> <AccessRequest xml:lang="en-US"> <AccessLicenseNumber>Your Access License</AccessLicenseNumber> <UserId>Your User Id</UserId> <Password>Your Password</Password> </AccessRequest> <?xml version="1.0"?> <RatingServiceSelectionRequest xml:lang="en-US"> <Request> <TransactionReference> <CustomerContext>Your Customer Context</CustomerContext> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>Rate</RequestOption> </Request> <Shipment> <RateInformation> <NegotiatedRatesIndicator/> </RateInformation> <Shipper> <Name>Shipper Name</Name> <AttentionName>Shipper Attention Name</AttentionName> <PhoneNumber>1234567890</PhoneNumber> <FaxNumber>1234567890</FaxNumber> <ShipperNumber>Your Shipper Number</ShipperNumber> <Address> <AddressLine1>Address Line 1</AddressLine1> <City>City</City> <StateProvinceCode>StateProvinceCode</StateProvinceCode> <PostalCode>PostalCode</PostalCode> <CountryCode>CountryCode</CountryCode> </Address> </Shipper> <ShipTo> <CompanyName>Ship To Company Name</CompanyName> <AttentionName>Ship To Attention Name</AttentionName> <PhoneNumber>1234567890</PhoneNumber> <FaxNumber>1234567890</FaxNumber> <Address> <AddressLine1>Address Line 1</AddressLine1> <City>City</City> <StateProvinceCode>StateProvinceCode</StateProvinceCode> <PostalCode>PostalCode</PostalCode> <CountryCode>CountryCode</CountryCode> </Address> </ShipTo> <ShipFrom> <CompanyName>Ship From Company Name</CompanyName> <AttentionName>Ship From Attention Name</AttentionName> <PhoneNumber>1234567890</PhoneNumber> <FaxNumber>1234567890</FaxNumber> <Address><AddressLine1>Address Line 1</AddressLine1> <City>City</City> <StateProvinceCode>StateProvinceCode</StateProvinceCode> <PostalCode>PostalCode</PostalCode> <CountryCode>CountryCode</CountryCode> </Address> </ShipFrom> <Service> <Code>59</Code> <Description>2nd Day Air AM</Description> </Service> <Package> <PackagingType> <Code>02</Code> <Description>UPS Package</Description> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>LBS</Code> </UnitOfMeasurement> <Weight>5</Weight> </PackageWeight> <Dimensions> <Length>10</Length> <Width>5</Width> <Height>7</Height> </Dimensions> </Package> </Shipment> </RatingServiceSelectionRequest>
XML File 1
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>Your Access License</AccessLicenseNumber>
<UserId>Your User Id</UserId>
<Password>Your Password</Password>
</AccessRequest>
Xml File 2
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>Your Customer Context</CustomerContext>
</TransactionReference>
<RequestAction>Rate</RequestAction>
<RequestOption>Rate</RequestOption>
</Request>
<Shipment>
<RateInformation>
<NegotiatedRatesIndicator/>
</RateInformation>
<Shipper>
<Name>Shipper Name</Name>
<AttentionName>Shipper Attention Name</AttentionName>
<PhoneNumber>1234567890</PhoneNumber>
<FaxNumber>1234567890</FaxNumber>
<ShipperNumber>Your Shipper Number</ShipperNumber>
<Address>
<AddressLine1>Address Line 1</AddressLine1>
<City>City</City>
<StateProvinceCode>StateProvinceCode</StateProvinceCode>
<PostalCode>PostalCode</PostalCode>
<CountryCode>CountryCode</CountryCode>
</Address>
</Shipper>
<ShipTo>
<CompanyName>Ship To Company Name</CompanyName>
<AttentionName>Ship To Attention Name</AttentionName>
<PhoneNumber>1234567890</PhoneNumber>
<FaxNumber>1234567890</FaxNumber>
<Address>
<AddressLine1>Address Line 1</AddressLine1>
<City>City</City>
<StateProvinceCode>StateProvinceCode</StateProvinceCode>
<PostalCode>PostalCode</PostalCode>
<CountryCode>CountryCode</CountryCode>
</Address>
</ShipTo>
<ShipFrom>
<CompanyName>Ship From Company Name</CompanyName>
<AttentionName>Ship From Attention Name</AttentionName>
<PhoneNumber>1234567890</PhoneNumber>
<FaxNumber>1234567890</FaxNumber>
<Address>
<AddressLine1>Address Line 1</AddressLine1>
<City>City</City>
<StateProvinceCode>StateProvinceCode</StateProvinceCode>
<PostalCode>PostalCode</PostalCode>
<CountryCode>CountryCode</CountryCode>
</Address>
</ShipFrom>
<Service>
<Code>59</Code>
<Description>2nd Day Air AM</Description>
</Service>
<Package>
<PackagingType>
<Code>02</Code>
<Description>UPS Package</Description>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>5</Weight>
</PackageWeight>
<Dimensions>
<Length>10</Length>
<Width>5</Width>
<Height>7</Height>
</Dimensions>
</Package>
</Shipment>
</RatingServiceSelectionRequest>
Have a sample XML
<persons>
<person>
<fname>John</fname>
<lname>Doe</lname>
<addresses>
<address>
<add_line1>Street</add_line1>
<zip>1234</zip>
<state>NY</state>
</address>
<address>
<add_line1>Street</add_line1>
<zip>1234</zip>
<state>PA</state>
</address>
<address>
</address>
</addresses>
</person>
</persons>
I can validate it against an XSD and I can get if it passes validation or not
Is it possible to run it through validation wherein I can get the exact record for which validation failed?
Bad XML:
<persons>
<person>
<fname>John</fname>
<lname>Doe</lname>
<addresses>
<address>
<add_line1>Street</add_line1>
<zip>1234</zip>
<state>NY</state>
</address>
<address>
<add_line1>Street</add_line1>
<zip>1234</zip>
<state>PAA</state>
</address>
<address>
</address>
</addresses>
</person>
</persons>
The above would fail state validation as state is PAA instead of PA.
So I am looking to get that state validation failed for John Doe and any other user
I can get the records used for creating the xml into a data table - not sure if it is possible to validate the records against XSD - figure the best option is to generate the xml against the xsd and create a log file of all records that failed validation.
I have a WCF service that works with a test client generated with SvcUtil.exe.
But my real client is another company that used different technology.
With the generated test client the XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<PostModel xmlns="http://tempuri.org/">
<model xmlns:a="http://schemas.datacontract.org/2004/07/SomeName.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Items>
<a:Item>
<a:SomeElement1>SomeValue</a:SomeElement1>
<a:SomeElement2>SomeValue</a:SomeElement2>
</a:Item>
<a:Item>
<a:SomeElement1>SomeValue</a:SomeElement1>
<a:SomeElement2>SomeValue</a:SomeElement2>
</a:Item>
</a:Items>
<a:MoreItems>
<a:MoreItem>
<a:SomeElement3>binary</a:SomeElement3>
</a:MoreItem>
</a:MoreItems>
</model>
</PostModel>
</s:Body>
</s:Envelope>
But the real client sends the xml without alias:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<PostModel xmlns="http://tempuri.org/">
<model xmlns="http://schemas.datacontract.org/2004/07/SomeName.Models">
<Items>
<Item>
<SomeElement1>SomeValue</SomeElement1>
<SomeElement2>SomeValue</SomeElement2>
</Item>
<Item>
<SomeElement1>SomeValue</SomeElement1>
<SomeElement2>SomeValue</SomeElement2>
</Item>
</Items>
<MoreItems>
<MoreItem>
<SomeElement3>binary</SomeElement3>
</MoreItem>
</MoreItems>
</model>
</PostModel>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The result is that the model that I receive in the endpoint is NULL.
If I catch the request in fiddler and edit it, add nothing but the alias for the model namespace and add it to the child-elements it works.
Is there a solution for this problem, as far as I know the XML that the client sends is valid XML, aliases are not mandatory.
The difference between the test client XML and the real client XML lies in the namespace of the element model. From the test client:
<PostModel xmlns="http://tempuri.org/">
<model xmlns:a="http://schemas.datacontract.org/2004/07/SomeName.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
This defines an element with local name "model". It has no namespace prefix so exists in the default namespace. However, it does not define a default namespace for itself -- instead it defines namespaces with prefixes "a" and "i". Thus it belongs in whatever default namespace its parent hierarchy defines, in this case "http://tempuri.org/" from its immediate parent.
In the real client's XML, the model element again has no prefix but does have its own default namespace declaration:
<PostModel xmlns="http://tempuri.org/">
<model xmlns="http://schemas.datacontract.org/2004/07/SomeName.Models">
Thus model falls into the namespace "http://schemas.datacontract.org/2004/07/SomeName.Models" rather than the parent's default namespace.
All the child elements of model are in the same namespace in both XML versions. It's only the model element itself which is inconsistent.
This inconsistency would explain the null model in the endpoint.
Is there a way to make a C#/.NET web service which normally produces XML like this
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<DHeader xmlns="http://www.abc.com" />
</soap:Header>
<soap:Body>
<Response xmlns="http://www.abc.com">
<Result>
<ErrorObject ObjectID="string" ErrorCode="" />
</Result>
</Response>
</soap:Body>
</soap:Envelope>
to produce XML like this.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapv:Header>
<DHeader xmlns="http://www.abc.com" />
</soapenv:Header>
<soapenv:Body>
<Response xmlns="http://www.abc.com">
<Result>
<ErrorObject ObjectID="string" ErrorCode="" />
</Result>
</Response>
</soapenv:Body>
</soapenv:Envelope>
This trying solve a problem with an AXIS client consuming a .NET web service. AXIS is choking on the soap namespace and needs a soapenv namespace. Changing the AXIS side is not possible.
any thoughts or comments would be great.
Here is the exact error as requested.
line -1: Element Envelope#http://www.w3.org/2003/05/soap-envelope is not a valid Envelope#http://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution.
soapenv is not a namespace - it's a namespace prefix.
As long as the prefixes refer to the same namespace, soap and soapenv refer to the same thing, and have the identical meaning.
It seems extremely unlikely that any version of AXIS is so badly broken as to treat the prefixes specially. You should assume you have a different problem. Please post the exact error you're receiving.
I am receiving the following error when calling a web service method.
Cannot assign object of type System.Xml.XmlNode[] to an object of type System.String.
The web service is a PHP service. I created my proxy class using wsdl.exe from the wsdl document defined here - http://webservice.intelecast.com.au/traffic/PublicSoap/server.php?wsdl
Below is the proxy client method I am calling.
[System.Web.Services.Protocols.SoapRpcMethodAttribute("http://webservice.intelecast.com.au/traffic/PublicSoap/server.php#getAllTraffic", RequestNamespace="http://webservice.intelecast.com.au/traffic/PublicSoap/server.php", ResponseNamespace="http://webservice.intelecast.com.au/traffic/PublicSoap/server.php")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public TmcInfo[] getAllTmcTraffic(string[] States, int[] EventCodes) {
object[] results = this.Invoke("getAllTmcTraffic", new object[] { //Error here
States,
EventCodes});
It appear the proxy class is failing to deal with the complex types/arrays defined in the wsdl...I am unsure now how to proceed can't find a solution on the web anywhere.
Below is the SOAP response i am receiving. This all appears valid.
<?xml version="1.0" encoding="iso-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://webservice.intelecast.com.au/traffic/PublicSoap/server.php">
<SOAP-ENV:Body>
<ns1:getAllTrafficResponse
xmlns:ns1="http://webservice.intelecast.com.au/traffic/PublicSoap/server.php">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:TrafficInfo[2]">
<item xsi:type="tns:TrafficInfo">
<id xsi:type="xsd:string">1245632068110</id>
<entryDate xsi:type="xsd:datetime">22/06/2009 10:54:28</entryDate>
<direction xsi:type="xsd:int">0</direction>
<extent xsi:type="xsd:int">1</extent>
<locationCode xsi:type="xsd:int">31593</locationCode>
<countryCode xsi:type="xsd:int">4</countryCode>
<ltn xsi:type="xsd:int">56</ltn>
<diversionAdvice xsi:type="xsd:int">0</diversionAdvice>
<slAdvice xsi:type="xsd:int">0</slAdvice>
<quantifier xsi:type="xsd:int">0</quantifier>
<suppInfoCode xsi:type="xsd:int">0</suppInfoCode>
<addEvent xsi:type="xsd:int">0</addEvent>
<detDivAdvice xsi:type="xsd:int">0</detDivAdvice>
<destinations xsi:type="xsd:int">0</destinations>
<clSourceProblem xsi:type="xsd:int">0</clSourceProblem>
<eventCode xsi:type="xsd:int">802</eventCode>
<timeInfo xsi:type="tns:TimeInfo">
<start xsi:type="xsd:string">21/06/2009 14:00:00</start>
<finish xsi:type="xsd:string">05/11/2009 14:00:00</finish>
<timeZone xsi:type="xsd:string">Australia/Brisbane</timeZone>
</timeInfo>
<location xsi:type="tns:Point">
<lat xsi:type="xsd:float">-27.3112692120521</lat>
<lon xsi:type="xsd:float">153.029100894928</lon>
</location>
<additionalStreetInfo
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:AdditionalStreetInfo[1]">
<item xsi:type="tns:AdditionalStreetInfo">
<street xsi:type="xsd:string">Bracken Ridge Rd</street>
<type xsi:type="xsd:string">CROSS</type>
</item>
</additionalStreetInfo>
<address xsi:type="tns:Address">
<streetNumber xsi:type="xsd:string"/>
<streetName xsi:type="xsd:string">Bracken Ridge Rd</streetName>
<suburb xsi:type="xsd:string">Bracken Ridge</suburb>
<state xsi:type="xsd:string">QLD</state>
</address>
</item>
<item xsi:type="tns:TrafficInfo">
<id xsi:type="xsd:string">1245632111995</id>
<entryDate xsi:type="xsd:datetime">22/06/2009 10:55:11</entryDate>
<direction xsi:type="xsd:int">1</direction>
<extent xsi:type="xsd:int">1</extent>
<locationCode xsi:type="xsd:int">31592</locationCode>
<countryCode xsi:type="xsd:int">4</countryCode>
<ltn xsi:type="xsd:int">56</ltn>
<diversionAdvice xsi:type="xsd:int">0</diversionAdvice>
<slAdvice xsi:type="xsd:int">0</slAdvice>
<quantifier xsi:type="xsd:int">0</quantifier>
<suppInfoCode xsi:type="xsd:int">0</suppInfoCode>
<addEvent xsi:type="xsd:int">0</addEvent>
<detDivAdvice xsi:type="xsd:int">0</detDivAdvice>
<destinations xsi:type="xsd:int">0</destinations>
<clSourceProblem xsi:type="xsd:int">0</clSourceProblem>
<eventCode xsi:type="xsd:int">802</eventCode>
<timeInfo xsi:type="tns:TimeInfo">
<start xsi:type="xsd:string">21/06/2009 14:00:00</start>
<finish xsi:type="xsd:string">05/11/2009 14:00:00</finish>
<timeZone xsi:type="xsd:string">Australia/Brisbane</timeZone>
</timeInfo>
<location xsi:type="tns:Point">
<lat xsi:type="xsd:float">-27.3125370752656</lat>
<lon xsi:type="xsd:float">153.042898178101</lon>
</location>
<additionalStreetInfo
xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:AdditionalStreetInfo[1]">
<item xsi:type="tns:AdditionalStreetInfo">
<street xsi:type="xsd:string">Bracken Ridge Rd</street>
<type xsi:type="xsd:string">CROSS</type>
</item>
</additionalStreetInfo>
<address xsi:type="tns:Address">
<streetNumber xsi:type="xsd:string"/>
<streetName xsi:type="xsd:string">Bracken Ridge Rd</streetName>
<suburb xsi:type="xsd:string">Bracken Ridge</suburb>
<state xsi:type="xsd:string">QLD</state>
</address>
</item>
</return>
</ns1:getAllTrafficResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Is it a bug in wsdl.exe? I have a few unpleasant encounters with wsdl.exe. Here are the problems outlined in my post:
The first issue it fails to handle
sequence with complex element. You
would think that in today's webservice
environment, a sequence of complex
elements is a norm. But apparently
Microsoft doesn't think so, and this
results in inability of wsdl.exe to
handle a sequence of complex elements.
What if you insist on using wsdl.exe
to generate proxy class for element
with a sequence of complex types? You
will get a cryptic exception: unable
to import binding * from namespace *
- unable to import operation *
- the datatype * is missing The second bug wsdl has is that it is not
permissible to have two web methods
that have the same return signature.
Yes, if one method returns a type of
ComplexType, the other methods must
have a different return type. Failing
to do so will result in an
System.InvalidOperationException: The
XML element * from namespace *
references a references a method and a
type exception.
Note that in both cases the messages
are cryptic. You won't actually know
what's going on behind the hood. And
this is the most frustrating of all.
You don't know whether you fail
because the tool is lousy, or because
you are not doing things right.
Maybe you can refer to this post for an alternative of wsdl.exe.
It's worth noting that rpc/encoded SOAP implementation have problems on complex types. One way around this problem is to convert the WSDL to Document/Literal format.