0
내 응용 프로그램에서 SOAP Webservice를 사용하고 있습니다. 내가 직면하고있는 문제는 SOAP 요청 본문에 하나의 추가 태그가 있다는 것입니다. SOAP 오류 오류가 발생합니다. "SoapFault - faultcode : 'soap : Server'faultstring : '서버가 요청을 처리 할 수 없습니다 .-> 개체 참조가 개체의 인스턴스로 설정되지 않았습니다.' faultactor : 'null'detail : [email protected] ". 여기 SOAP 요청 본문에서 둘 이상의 태그를 처리하는 방법
여기POST /appws.asmx HTTP/1.1
Host: www.xxxxxx.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://xxxxxxx.com/saveCustomerProfile"
<?xml version="1.0" encoding="utf-8"?>
<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:Body>
<saveCustomerProfile xmlns="http://xxxxxx.com/">
<customerProfile>
<id>long</id>
<name>string</name>
<lastName>string</lastName>
<phoneNumber>string</phoneNumber>
<zipCode>string</zipCode>
<email>string</email>
<birthday>string</birthday>
<gender>string</gender>
<emailExclusiveSavings>boolean</emailExclusiveSavings>
<textExclusiveSavings>boolean</textExclusiveSavings>
</customerProfile>
</saveCustomerProfile>
</soap:Body>
</soap:Envelope>
내가 문제가 일어나고 어디를 찾을 수
SoapObject request = new SoapObject(NAMESPACE, "saveCustomerProfile");
request.addProperty("id", 0);
request.addProperty("name","aaaaa");
request.addProperty("lastName","bbbbbb");
request.addProperty("phoneNumber", "1234567890");
request.addProperty("zipCode", "1234");
request.addProperty("email", "[email protected]");
request.addProperty("birthday", "02/02/2011");
request.addProperty("gender", "male");
request.addProperty("emailExclusiveSavings","true");
request.addProperty("textExclusiveSavings", "false");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(URL);
httpTransport.call(SOAP_ACTION, envelope);
System.out.println("response "+envelope.getResponse());
이 웹 서비스를 호출 할 수 사용하고있는 코드입니다 .... SOAP 요청입니다.
<saveCustomerProfile xmlns="http://xxxxxx.com/">
<customerProfile>
는 일반적으로 하나의 주요 태그가 SOAP 본체 내부에있을 것, 여기에 내가 두 가지를 가지고. 나는 그것을 어떻게 다룰 지 모른다. 나는 다른 SOAP 웹 서비스들 모두가 같은 코드에서 작업하고 있는지 확인했다. 도와주세요. 답장을 보내
감사합니다 .... 그러나 이것은 그것이 우리가 내가 찾던 좋아, SOAP 요청 정상적인 방법을하지 만들 수있는 방법입니다, 도움이되지 않습니다 : – Aju