私はSOAPにはとても慣れていないので、私の愚かさは気になりません。 私はUPCコードで送信しretriveしたい ...これは私が取得するためにやっているものですiOS上のSOAPが動作しない
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="HTTP://207.7.208.250" targetNamespace="HTTP://207.7.208.250">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:intf="HTTP://207.7.208.250" elementFormDefault="qualified" targetNamespace="HTTP://207.7.208.250">
<element name="ProductInquiryResponse">
<complexType>
<sequence>
<element name="EclipsePN" type="string"/>
<element name="Description" type="string"/>
<element name="AlternateDescription" type="string"/>
<element name="UPC" type="string"/>
<element name="Catalog" type="string"/>
<element name="PartNumber" type="string"/>
<element name="AvailQty" type="string"/>
<element name="AvailDate" type="string"/>
<element name="AvailUOM" type="string"/>
<element name="Price" type="string"/>
<element name="PriceUOM" type="string"/>
<element name="ImageURL" type="string"/>
<element name="SpecSheetURL" type="string"/>
<element name="ErrorDescription" type="string"/>
</sequence>
</complexType>
</element>
<element name="ProductInquiry">
<complexType>
<sequence>
<element name="Login" type="string"/>
<element name="Password" type="string"/>
<element name="EclipsePN" type="string"/>
<element name="UPC" type="string"/>
<element name="HomeBranch" type="string"/>
</sequence>
</complexType>
</element>
<element name="CALL_SSI_MOBILE_PROD_INQ">
<complexType>
<sequence>
<element ref="intf:ProductInquiry"/>
</sequence>
</complexType>
</element>
<element name="CALL_SSI_MOBILE_PROD_INQResponse">
<complexType>
<sequence>
<element ref="intf:ProductInquiryResponse"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="CALL_SSI_MOBILE_PROD_INQResponse">
<wsdl:part name="parameters" element="intf:CALL_SSI_MOBILE_PROD_INQResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="CALL_SSI_MOBILE_PROD_INQRequest">
<wsdl:part name="parameters" element="intf:CALL_SSI_MOBILE_PROD_INQ"></wsdl:part>
</wsdl:message>
<wsdl:portType name="SSI_MOBILE_PROD_INQ">
<wsdl:operation name="CALL_SSI_MOBILE_PROD_INQ">
<wsdl:input name="CALL_SSI_MOBILE_PROD_INQRequest" message="intf:CALL_SSI_MOBILE_PROD_INQRequest"></wsdl:input>
<wsdl:output name="CALL_SSI_MOBILE_PROD_INQResponse" message="intf:CALL_SSI_MOBILE_PROD_INQResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SSI_MOBILE_PROD_INQSOAPBinding" type="intf:SSI_MOBILE_PROD_INQ">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CALL_SSI_MOBILE_PROD_INQ">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="CALL_SSI_MOBILE_PROD_INQRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="CALL_SSI_MOBILE_PROD_INQResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SSI_MOBILE_PROD_INQ">
<wsdl:port name="SSI_MOBILE_PROD_INQ" binding="intf:SSI_MOBILE_PROD_INQSOAPBinding">
<wsdlsoap:address location="HTTP://207.7.208.250:31361/SSI_MOBILE_PROD_INQ"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
次のようにhttp://207.7.208.250:31361/SSI_MOBILE_PROD_INQ
WSDLに位置SOAP Webサービスがある持っています結果として得られるXMLを解析し、データを取得します。
NSMutableString *sRequest = [[NSMutableString alloc] init];
[sRequest appendString:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
[sRequest appendString:@"<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/\">"];
[sRequest appendString:@"<soap:Body>"];
[sRequest appendString:@"<SSI_MOBILE_PROD_INQ xmlns=\"http://207.7.208.250:31361/SSI_MOBILE_PROD_INQ/\">"];
[sRequest appendString:@"<CALL_SSI_MOBILE_PROD_INQ>"];
[sRequest appendString:@"<UPC>"];
[sRequest appendString:@"78285630648"];
[sRequest appendString:@"</UPC>"];
[sRequest appendString:@"</CALL_SSI_MOBILE_PROD_INQ>"];
[sRequest appendString:@"</SSI_MOBILE_PROD_INQ>"];
[sRequest appendString:@"</soap:Body>"];
[sRequest appendString:@"</soap:Envelope>"];
NSURL *weatherServiceURL = [NSURL URLWithString:@"http://207.7.208.250:31361/SSI_MOBILE_PROD_INQ"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:weatherServiceURL];
[request addValue:@"text/xml; charset:UTF-8" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"http://207.7.208.250:31361/SSI_MOBILE_PROD_INQ" forHTTPHeaderField:@"SOAPAction"];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[sRequest dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (conn) {
myMutableData = [NSMutableData data];
NSLog(@"Conn is true");
}
[NSURLConnection connectionWithRequest:request delegate:self];
NSError *WSerror;
NSURLResponse *WSresponse;
NSData *returnData = (NSMutableData*)[NSURLConnection sendSynchronousRequest:request
returningResponse:&WSresponse error:&WSerror];
if(WSerror){
NSLog(@"%@", [WSerror localizedDescription]);
}
if (returnData) {
NSString *content = [NSString stringWithUTF8String:[myMutableData bytes]];
DebugLog(@"yeah %@", content);
}
コンテンツ文字列からの出力はありません。 私はSOAPメソッドを正しく呼び出さないと思います.... あなたの考えは?
をあなたはここにこれを試してみましたか? http://sudzc.com/ – HeikoG
はい、私が試した最初のことでした それは私のためにコンパイル可能なコードを生成しませんでした.... –
sudzcは私にとって非常に効率的であることを証明しています、あなたは問題のいくつかの詳細を提供できますか? sudzcのコードで。あなたのサービスがパスワードと同じ名前になっていることはめったにあり得ない問題があることに注意してください。ファイルの上にもう一方のファイルを上書きして、SDKを解除する –