iphone - SOAP message error with addiotional XML tags -


nsstring *urlstring = @"http://172.29.165.219:8090/abc/services/abc"; nsstring *soapmessage = [nsstring stringwithformat:                          @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"                          "<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/\">\n"                          "<soap:body>\n"                          "<getuserinfo>\n"                          "<email>%@</email>\n"                          "<pwd>%@</pwd>\n"                          "</getuserinfo>\n"                          "</soap:body>\n"                          "</soap:envelope>\n", @"babla.sharan@tcs.com",@"ugfzc0axmjm="//,@"50006f0063006b0065007400500043000000-444556494345454d00",@"pocketpc"                          ]; nsmutableurlrequest *loginrequest = [requestgenerator -generatesoaprequestwithurlstring:urlstring soapmessage:soapmessage contenttype:@"text/xml; charset=utf-8" action:@"getuserinfo"]; webservicehandler *connection = [[webservicehandler alloc]init]; 

for above code, works fine, when add additional tag parent tag id , password

nsstring *urlstring = @"http://172.29.165.219:8090/abc/services/abc"; nsstring *soapmessage = [nsstring stringwithformat:                          @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"                          "<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/\">\n"                          "<soap:body>\n"                          "<getuserinfo>\n"                          **"<abc>\n"**                                                      "<email>%@</email>\n"                          "<pwd>%@</pwd>\n"                                                      **"</abc>\n"**                          "</getuserinfo>\n"                          "</soap:body>\n"                          "</soap:envelope>\n", @"babla.sharan@tcs.com",@"ugfzc0axmjm="//,@"50006f0063006b0065007400500043000000-444556494345454d00",@"pocketpc"                          ]; nsmutableurlrequest *loginrequest = [requestgenerator generatesoaprequestwithurlstring:urlstring soapmessage:soapmessage contenttype:@"text/xml; charset=utf-8" action:@"getuserinfo"]; webservicehandler *connection = [[webservicehandler alloc]init]; 

it shows exception , error:

org.xml.sax.saxexception: simpledeserializer encountered child element, not expected, in trying deserialize.

it doesn't allow me hit server.

here in second soap message sending additional parent tag information, may not recognized server. if tag optional there should no problem @ all, if undesired should not use it. below excerpts w3.org(http://www.w3.org/tr/2000/note-soap-20000508/) .... tells receiving , processing of soap request.

a soap application receiving soap message must process message performing      following actions in order listed below:           1. identify parts of soap message intended application           2. verify mandatory parts identified in step 1 supported   application message (see section 4.2.3) , process them accordingly.  if   not case discard message .  processor may ignore optional parts identified in step 1 without affecting outcome of processing.         3. if soap application not ultimate destination of message      remove parts identified in step 1 before forwarding message.     processing message or part of message requires soap processor    understands, among other things, exchange pattern being used (one way,    request/response, multicast, etc.), role of recipient in pattern,    employment (if any) of rpc mechanisms such 1 documented in section 7,    representation or encoding of data, other semantics necessary correct    processing 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -