I am in dire need of help in trying to get the client code for a web
service to work. i don't have a WSDL for the service so i created my own
ASP.NET service to test with. i converted the DTD files that i was given to
xsd files and used the xsd tool to create the classes. i used those classes
to create the parameters for the web method defined as follows:
[WebMethod]
publicSchema.su bmitOrderBatchR esponse
submitOrderBatc h(Schema.submit OrderBatch sob)
{
Schema.submitOr derBatchRespons e sbor = new
Schema.submitOr derBatchRespons e();
return sbor;
}
The proxy code is generated as:
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Web.Serv ices.WebService BindingAttribut e(Name="OrderOp erationsSoap",
Namespace="http ://tempuri.org/")]
public class OrderOperations :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {
/// <remarks/>
public OrderOperations () {
this.Url = "http://localhost/Emulator/Emulator.asmx";
}
/// <remarks/>
[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/submitOrderBatc h",
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return:
System.Xml.Seri alization.XmlEl ementAttribute( Namespace="http ://tempuri.org/submitOrderBatc hResponse.xs")]
public submitOrderBatc hResponse
submitOrderBatc h([System.Xml.Seri alization.XmlEl ementAttribute( Namespace="http ://tempuri.org/submitOrderBatc h.xs")]
submitOrderBatc h sob) {
object[] results = this.Invoke("su bmitOrderBatch" , new object[] {sob});
return ((submitOrderBa tchResponse)(re sults[0]));
my client code works on the local host but when i go out to the real
service it fails.
i created the client in VS.NET 2003 and am referencing the web service that
i created.
I compared the logs of what i am sending to what i am supposed to send and
the SOAP headers appear to be missing some info and some of the tags are
wrong:
This is what is being sent from the proxy
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBat ch xmlns="urn:Orde rOperations">
<sob CustomerBatchID ="122" xmlns="http://tempuri.org/submitOrderBatc h.xs">
<Customer CustomerID="109 7" OrderSource="NV L TEST CUSTOMER (CUSTOMER)" />
<Orders> . . .
This is what i should be sending in the body
<ns1:submitOrde rBatch xmlns:ns1="urn: OrderOperations "
SOAP-ENV:encodingSty le="http://xml.apache.org/xml-soap/literalxml">
<orderBatchElem ent>
1) why does the first line show up? (?xml version ... etc.)
2) how can i get the correct SOAP headers?
3) how do i get the correct tags? ns1:submitOrder Batch
xmlns:ns1="urn: OrderOperations " instead of
xmlns="http://tempuri.org/submitOrderBatc h.xs">
thanks very much