2016-07-27 2 views
0

저는 savon 2.11.1을 사용하고 있으며 기억하는 것보다 XML 웹 서비스에 대해 더 많은 것을 잊어 버렸습니다. 다음과 같은 문제가 :네임 스페이스/유효하지 않은 콘텐츠

<wsdl:definitions xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://myhost.com/ns/2008/08/15/webservices/ASUserManagement_1/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsdws="http://myhost.com/ns/2008/08/15/webservices/AccessServices" name="ASUserManagement_1" targetNamespace="http://myhost.com/ns/2008/08/15/webservices/UserManagement/wsdl"> 
<wsdl:types> 
<xs:schema xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://myhost.com/ns/2008/08/15/webservices/AccessServices"> 
<xs:include schemaLocation="http://myhost.com:80/service/UserManagement?xsd=1"/> 
</xs:schema> 
</wsdl:types> 
<wsdl:message name="GetUserDetailsInput"> 
<wsdl:part name="GetUserDetails" element="xsdws:GetUserDetails"/> 
</wsdl:message> 
</wsdl:message> 
<wsdl:message name="GetAllUserDetailsInput"> 
<wsdl:part name="GetAllUserDetails" element="xsdws:GetAllUserDetails"/> 
</wsdl:message> 
<wsdl:portType name="ASUserManagement"> 
<wsdl:operation name="GetUserDetails_1"> 
<wsdl:input message="tns:GetUserDetailsInput"/> 
<wsdl:output message="tns:GetUserDetailsOutput"/> 
</wsdl:operation> 
<wsdl:operation name="GetAllUserDetails_1"> 
<wsdl:input message="tns:GetAllUserDetailsInput"/> 
<wsdl:output message="tns:GetAllUserDetailsOutput"/> 
</wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="ASUserManagementBinding" type="AAA-ASUserManagement"> 
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="GetUserDetails_1"> 
<soap:operation soapAction="GetUserDetails_1"/> 
<wsdl:input> 
<soap:body parts="GetUserDetails" use="literal"/> 
</wsdl:input> 
<wsdl:output> 
<soap:body parts="GetUserDetailsResponse" use="literal"/> 
</wsdl:output> 
</wsdl:operation> 
<wsdl:operation name="GetAllUserDetails_1"> 
<soap:operation soapAction="GetAllUserDetails_1"/> 
<wsdl:input> 
<soap:body parts="GetAllUserDetails" use="literal"/> 
</wsdl:input> 

이 그래서 불통 (간결하게 정돈) 내가 볼 실제 WSDL 선언에 가까운 찾고

Savon::SOAPFault: (S:Client) org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'xsdws:GetUserDetails'. 

: 이렇게

client = Savon.client(wsdl: 'http://myhost.com/service?wsdl') 
client.operations 
=> [:get_user_details_1, :get_all_user_details_1, :set_user_details_1] 
client.call(:get_user_details_1, message: { uuid: "ABC" }) 

나에게 오류 메시지를 받았습니다 xs : schema 요소에 선언 된 네임 스페이스를 포함해야합니다.

client = Savon.client(wsdl: 'http://myhost.com/service?wsdl', namespace: 'http://myhost.com/ns/2008/08/15/webservices/AccessServices') 
client.call(:get_user_details_1, message: { uuid: "ABC" }) 
Savon::SOAPFault: (S:Client) org.xml.sax.SAXParseException; cvc-complex-type.2.4.a: Invalid content was found starting with element 'uuid'. One of '{"http://www.reuters.com/ns/2008/08/15/webservices/AAA-AccessServices_1":uuid}' is expected. 

내가 잘못 여기서 뭐하는거야 확실하지 - 피들러에 자동 생성 된 .NET 클라이언트 프록시 코드의 샘플 유효한 요청은 다음과 같습니다

<?xml version="1.0" encoding="utf-8"?><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><GetAllUserDetails xmlns="http://myhost.com/ns/2008/08/15/webservices/AccessServices"><uuid>ABC</uuid></GetAllUserDetails></soap:Body></soap:Envelope> 

내가 잘못을 범했습니다 어떤 생각?

답변

0

log_level 및 log가 true 인 동안 namespace_identifier 및 namespaces를 클라이언트 내부의 매개 변수로 설정할 수 있습니다.

Savon.client(
     wsdl: "http://myhost.com/service?wsdl", 
     log: true, 
     log_level: :debug, 
     pretty_print_xml: true, 
     namespace_identifier: :xsdws, 
     namespaces: {"xmlns:xsdws" => "http://myhost.com/ns/2008/08/15/webservices/AccessServices","xmlns:tns"=>"http://myhost.com/ns/2008/08/15/webservices/ASUserManagement_1/wsdl"} 

    ) 

희망 사항은 문제를 파헤치는 데 도움이됩니다.

건배