![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
| SOAP-ENV:Body |
|
-----Original Message----- OK, I am having a problem getting the xml to format for this soap message. SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xe="urn:mine" xmlns:xe1=" urn:VerifyStatus" xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:Body xe1:standard SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" xe1:key xsi:type="xe:messagekey" partnerkey xsi:type="xsd:string">someguy</partnerkey companykey xsi:type="xsd:string">blah,blah</companykey /xe1:key /xe1:standard /SOAP-ENV:Body /SOAP-ENV:Envelope Can anyone help. here is the webmethod: [WebMethod (Description="Validate SOAP server availability and Message Key integrity")] [TraceExtension()] [SoapDocumentMethod ("http://172.17.89.26/standard", RequestNamespace="http://172.17.89.26/standard", ResponseNamespace="http://172.17.89.26/standardResponse", Use=SoapBindingUse.Encoded) ] public keys standard([XmlElement("key")] messagekey key) { keys kys = new keys(); //Make sure Embrasure is who is calling us if(key.partnerKey.CompareTo("Embrasure") == 0) { // Validate the login and Embrasure string[] ks = getkey(key.partnerKey, key.companyKey); kys.partnerKey = ks[0]; kys.companyKey = ks[1]; } return kys; } here is the messagekey class: [XmlRoot("key")] public class messagekey { public string partnerKey=""; public string companyKey = ""; public messagekey() { } } and the responding keys class [XmlRoot("return")] public class keys { public string partnerKey=""; public string companyKey = ""; [XmlElement("timestamp")] public DateTime timestamp; public keys() { timestamp=DateTime.Now; } } SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xe="urn:mine" xmlns:xe1=" urn:VerifyStatus" xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:Body xe1:standard SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" xe1:key xsi:type="xe:messagekey" partnerkey xsi:type="xsd:string">someguy</partnerkey companykey xsi:type="xsd:string">blah,blah</companykey /xe1:key /xe1:standard /SOAP-ENV:Body /SOAP-ENV:Envelope the response should look like this. SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:Body ns1:standardResponse xmlns:ns1="urn:VerifyStatus" SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" return xmlns:ns2="urn:mine" xsi:type="ns2:messagekey" partnerkey xsi:type="xsd:string">PARTNER KEY</partnerkey companykey xsi:type="xsd:string">COMPANY KEY</companykey timestamp xsi:type="xsd:date">YYYY-MM-DD HH24:MI:SS </timestamp /return /ns1:standardResponse /SOAP-ENV:Body /SOAP-ENV:Envelope I cant get the response nor does the method see the message object being passed in. Does any one have any ideas. I dont want to hack teh XML stream going out. Thanks Dan . |
#2
| |||
| |||
|
|
Content-Class: urn:content-classes:message From: "Dan" <daniel_meland (AT) msn (DOT) com Sender: "Dan" <daniel_meland (AT) msn (DOT) com References: <0e2d01c36d84$51e9e6e0$a601280a (AT) phx (DOT) gbl Subject: Complex soap messages with structures Date: Fri, 29 Aug 2003 10:03:07 -0700 Lines: 261 Message-ID: <019801c36e4f$6afb6d40$a301280a (AT) phx (DOT) gbl MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Thread-Index: AcNuT2r4Lxah9o6KQIOECwinUacaCA== Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es Path: cpmsftngxa06.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservic es:19100 NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es Now I am really confused. here is the stream going in SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xe="urn:embrasure" xmlns:xe1=" urn:VerifyStatus" xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:Body xe1:standard SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding /" xe1:key xsi:type="xe:messagekey" partnerkey xsi:type="xsd:string">Embasure</partnerkey companykey xsi:type="xsd:string">PHTRopphile,disney</companykey /xe1:key /xe1:standard /SOAP-ENV:Body /SOAP-ENV:Envelope Here is the server response: 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 soap:Fault faultcode>soap:Client</faultcode faultstring>System.Web.Services.Protocols.SoapExce ption: Server was unable to read request. --- System.InvalidOperationException: There is an error in XML document (11, 6). ---> System.InvalidOperationException: standard xmlns=' urn:VerifyStatus'> was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializat ionReader1.Read17_standard() --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader, String encodingStyle) at System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader) at System.Web.Services.Protocols.SoapServerProtocol.R eadParame ters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.R eadParame ters() at System.Web.Services.Protocols.WebServiceHandler.In voke() at System.Web.Services.Protocols.WebServiceHandler.Co reProcess Request()</faultstring detail / /soap:Fault /soap:Body /soap:Envelope What am I doing wrong! te service is set up as : /// Make service accessible from the outside [WebService (Namespace="http://172.17.8.26/Soap" )] [SoapRpcService (RoutingStyle=SoapServiceRoutingStyle.SoapAction)] public class Service1 : System.Web.Services.WebService and the method is: [ SoapRpcMethod(Action="standard", RequestNamespace="VerifyStatus", RequestElementName="standard", ResponseNamespace="VerifyStatus", ResponseElementName="standardResponse")] // standard ping call with key passed for verifystatus [WebMethod (Description="Validate SOAP server availability and Message Key integrity")] public messagekey standard(messagekey key) { messagekey kys = new keys(); //Make sure Embrasure is who is calling us if(key.partnerKey.CompareTo("Embrasure") == 0) { // Validate the login and Embrasure string[] ks = getkey(key.partnerKey, key.companyKey); kys.partnerKey = ks[0]; kys.companyKey = ks[1]; } return kys; } Why cant it see the namespace for the call! HELP Thanks Dan -----Original Message----- OK, I am having a problem getting the xml to format for this soap message. SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xe="urn:mine" xmlns:xe1=" urn:VerifyStatus" xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:Body xe1:standard SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" xe1:key xsi:type="xe:messagekey" partnerkey xsi:type="xsd:string">someguy</partnerkey companykey xsi:type="xsd:string">blah,blah</companykey /xe1:key /xe1:standard /SOAP-ENV:Body /SOAP-ENV:Envelope Can anyone help. here is the webmethod: [WebMethod (Description="Validate SOAP server availability and Message Key integrity")] [TraceExtension()] [SoapDocumentMethod ("http://172.17.89.26/standard", RequestNamespace="http://172.17.89.26/standard", ResponseNamespace="http://172.17.89.26/standardResponse", Use=SoapBindingUse.Encoded) ] public keys standard([XmlElement("key")] messagekey key) { keys kys = new keys(); //Make sure Embrasure is who is calling us if(key.partnerKey.CompareTo("Embrasure") == 0) { // Validate the login and Embrasure string[] ks = getkey(key.partnerKey, key.companyKey); kys.partnerKey = ks[0]; kys.companyKey = ks[1]; } return kys; } here is the messagekey class: [XmlRoot("key")] public class messagekey { public string partnerKey=""; public string companyKey = ""; public messagekey() { } } and the responding keys class [XmlRoot("return")] public class keys { public string partnerKey=""; public string companyKey = ""; [XmlElement("timestamp")] public DateTime timestamp; public keys() { timestamp=DateTime.Now; } } SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xe="urn:mine" xmlns:xe1=" urn:VerifyStatus" xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:Body xe1:standard SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" xe1:key xsi:type="xe:messagekey" partnerkey xsi:type="xsd:string">someguy</partnerkey companykey xsi:type="xsd:string">blah,blah</companykey /xe1:key /xe1:standard /SOAP-ENV:Body /SOAP-ENV:Envelope the response should look like this. SOAP-ENV:Envelope xmlns:SOAP- ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:Body ns1:standardResponse xmlns:ns1="urn:VerifyStatus" SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin g /" return xmlns:ns2="urn:mine" xsi:type="ns2:messagekey" partnerkey xsi:type="xsd:string">PARTNER KEY</partnerkey companykey xsi:type="xsd:string">COMPANY KEY</companykey timestamp xsi:type="xsd:date">YYYY-MM-DD HH24:MI:SS </timestamp /return /ns1:standardResponse /SOAP-ENV:Body /SOAP-ENV:Envelope I cant get the response nor does the method see the message object being passed in. Does any one have any ideas. I dont want to hack teh XML stream going out. Thanks Dan . |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |