2011-12-21 2 views
1

gSOAP 용 서비스를 정의하기 위해 .wsdl 파일을 만들고 있습니다. 서비스의 요청 하나, 나는 요청의 일부로 사용자 정의 형식을 사용하려면,하지만 바로 그것을 얻을 수 없으며, 문제가 무엇인지 모르는 :C++ gSOAP wsdl 유형

<definitions name="Uploader" 
    targetNamespace="http://192.168.2.113/uploader/uploader.wsdl" 
    xmlns:tns="http://192.168.2.113/uploader/uploader.wsdl" 
    [...]> 
[...] 
<types> 
    <schema targetNamespace="http://192.168.2.113/uploader/uploader.wsdl" 
     xmlns="http://www.w3.org/2001/XMLSchema"> 

     <element name="FileInformation"> 
      <complexType><all> 
       <element name="sFilename" type="string"/> 
       <element name="bDirectory" type="boolean"/> 
      </all></complexType> 
     </element> 

     [...] 

     <element name="UploadRequest"> 
      <complexType><all> 
       <element name="fileInfo" type="tns:FileInformation"/> 
      </all></complexType> 
     </element> 

     [...] 

    </schema> 
</types> 
[...] 
</definitions> 

내가하려고하면 fileInfo 회원이 문자열로 정의됩니다 그것에서 wsdl2h -o Uploader.h http://192.168.2.113/uploader/uploader.wsdl와 헤더 파일을 생성하고, 나는 다음과 같은 경고 얻을 : 나는 몇 WSDL 자신을 파일을 작성하려고했습니다

Warning: could not find element 'fileInfo' type '"http://192.168.2.113/uploader/uploader.wsdl":FileInformation' in schema http://192.168.2.113/uploader/uploader.wsdl 

답변

1

을, 그러나 나는 그들이 발견 주로 XML 네임 스페이스 때문에 제대로하기가 어렵 기 때문에 C++로 클래스를 작성하고 WSDL 파일을 자동으로 생성하는 것이 좋습니다 그것들을 다른 방법으로 사용하는 대신에 그것들로부터 matically하게.

이것이 가능하지 않다면이 thread을 살펴 보시기 바랍니다. 스키마를 이와 같이 변경하면 작동 할 수도 있습니다.

<definitions name="Uploader" 
targetNamespace="http://192.168.2.113/uploader/uploader.wsdl" 
xmlns:tns="http://192.168.2.113/uploader/uploader.wsdl"> 

<types> 
    <schema targetNamespace="http://192.168.2.113/uploader/uploader.wsdl" 
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

     <xsd:element name="FileInformation" type="tns:FileInformation" /> 
     <xsd:complexType name="FileInformation"> 
      <xsd:all> 
       <xsd:element name="sFilename" type="string"/> 
       <xsd:element name="bDirectory" type="boolean"/> 
      </xsd:all> 
     </xsd:complexType> 

     <xsd:element name="UploadRequest" type="tns:UploadRequest"/> 
     <xsd:complexType name="UploadRequest"> 
      <xsd:all> 
       <xsd:element name="fileInfo" type="tns:FileInformation"/> 
      </xsd:all> 
     </xsd:complexType> 

    </schema> 
</types> 
</definitions> 
+0

완벽하고 고맙습니다. 네, 정말로 생성 된 파일을 사용해야합니다. 나는 내가 처음으로 이런 일을하면 더 잘 SOAP을 이해할 것이라고 생각하고있다. – nijansen

+0

당신은 환영합니다! 나는 당신 자신의 문제를 겪어 왔고 WSDL 파일을 작성하여 자기 자신이 정말로 복잡 할 수 있다고 믿는다. – Felipe