>

서버에 원시 SOAP 요청을 보내야합니다. 내 요청은 다음과 같습니다.

POST http://10.76.243.43:8080/registry/services/xds-iti18 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8
Content-Length: 6383
Host: 10.76.243.43:8080
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn1="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">   <soap:Header/>   <soap:Body>      <urn:AdhocQueryRequest id="?" comment="?" federated="false" federation="?" startIndex="0" maxResults="-1">         <!--Optional:-->         <urn1:RequestSlotList>            <!--Zero or more repetitions:-->            <urn2:Slot name="?" slotType="?">               <urn2:ValueList>                  <urn2:Value>?</urn2:Value>               </urn2:ValueList>            </urn2:Slot>         </urn1:RequestSlotList>         <urn:ResponseOption returnType="RegistryObject" returnComposedObjects="false"/>         <urn2:AdhocQuery id="?" home="?" lid="?" objectType="?" status="?">            <!--Zero or more repetitions:-->            <urn2:Slot name="?" slotType="?">               <urn2:ValueList>                  <urn2:Value>?</urn2:Value>               </urn2:ValueList>            </urn2:Slot>            <!--Optional:-->            <urn2:Name>               <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>            </urn2:Name>            <!--Optional:-->            <urn2:Description>               <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>            </urn2:Description>            <!--Optional:-->            <urn2:VersionInfo versionName="1.1" comment="?"/>            <!--Zero or more repetitions:-->            <urn2:Classification id="?" home="?" lid="?" objectType="?" status="?" classificationScheme="?" classifiedObject="?" classificationNode="?" nodeRepresentation="?">               <!--Zero or more repetitions:-->               <urn2:Slot name="?" slotType="?">                  <urn2:ValueList>                     <urn2:Value>?</urn2:Value>                  </urn2:ValueList>               </urn2:Slot>               <!--Optional:-->               <urn2:Name>                  <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>               </urn2:Name>               <!--Optional:-->               <urn2:Description>                  <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>               </urn2:Description>               <!--Optional:-->               <urn2:VersionInfo versionName="1.1" comment="?"/>               <!--Zero or more repetitions:-->               <urn2:Classification/>               <!--Zero or more repetitions:-->               <urn2:ExternalIdentifier id="?" home="?" lid="?" objectType="?" status="?" registryObject="?" identificationScheme="?" value="?">                  <!--Zero or more repetitions:-->                  <urn2:Slot name="?" slotType="?">                     <urn2:ValueList>                        <urn2:Value>?</urn2:Value>                     </urn2:ValueList>                  </urn2:Slot>                  <!--Optional:-->                  <urn2:Name>                     <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>                  </urn2:Name>                  <!--Optional:-->                  <urn2:Description>                     <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>                  </urn2:Description>                  <!--Optional:-->                  <urn2:VersionInfo versionName="1.1" comment="?"/>                  <!--Zero or more repetitions:-->                  <urn2:Classification/>                  <!--Zero or more repetitions:-->                  <urn2:ExternalIdentifier/>               </urn2:ExternalIdentifier>            </urn2:Classification>            <!--Zero or more repetitions:-->            <urn2:ExternalIdentifier id="?" home="?" lid="?" objectType="?" status="?" registryObject="?" identificationScheme="?" value="?">               <!--Zero or more repetitions:-->               <urn2:Slot name="?" slotType="?">                  <urn2:ValueList>                     <urn2:Value>?</urn2:Value>                  </urn2:ValueList>               </urn2:Slot>               <!--Optional:-->               <urn2:Name>                  <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>               </urn2:Name>               <!--Optional:-->               <urn2:Description>                  <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>               </urn2:Description>               <!--Optional:-->               <urn2:VersionInfo versionName="1.1" comment="?"/>               <!--Zero or more repetitions:-->               <urn2:Classification id="?" home="?" lid="?" objectType="?" status="?" classificationScheme="?" classifiedObject="?" classificationNode="?" nodeRepresentation="?">                  <!--Zero or more repetitions:-->                  <urn2:Slot name="?" slotType="?">                     <urn2:ValueList>                        <urn2:Value>?</urn2:Value>                     </urn2:ValueList>                  </urn2:Slot>                  <!--Optional:-->                  <urn2:Name>                     <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>                  </urn2:Name>                  <!--Optional:-->                  <urn2:Description>                     <urn2:LocalizedString xml:lang="en-US" charset="UTF-8" value="?"/>                  </urn2:Description>                  <!--Optional:-->                  <urn2:VersionInfo versionName="1.1" comment="?"/>                  <!--Zero or more repetitions:-->                  <urn2:Classification/>                  <!--Zero or more repetitions:-->                  <urn2:ExternalIdentifier/>               </urn2:Classification>               <!--Zero or more repetitions:-->               <urn2:ExternalIdentifier/>            </urn2:ExternalIdentifier>            <!--Optional:-->            <urn2:QueryExpression queryLanguage="?">               e
               <!--You may enter ANY elements at this point-->               gero
            </urn2:QueryExpression>         </urn2:AdhocQuery>      </urn:AdhocQueryRequest>   </soap:Body></soap:Envelope>

이것은 SOAP UI (웹 서비스의 wsdl 사용)에 의해 생성 된 표준 원시 요청이므로 여기로 보내면 HTTP code 200과 정상적인 응답을받습니다. Java를 사용하여 보내려고하므로 다음을 수행합니다.

byte[] encoded= Files.readAllBytes(Paths.get("C:\\Users\\timofb\\Documents\\testtest.txt"));//file with my raw request
String soapXml= new String(encoded, StandardCharsets.UTF_8);
Socket socket= new Socket("10.76.243.43", 8080);
BufferedWriter out= new BufferedWriter(
            new OutputStreamWriter(socket.getOutputStream(), "UTF8"));
BufferedReader in= new BufferedReader(
            new InputStreamReader(socket.getInputStream()));
out.write(soapXml);
out.flush();
System.out.println("\n * Response");
String line;
while ((line= in.readLine()) != null) {
     System.out.println(line);
}
in.close();

처리하는 동안 Fault가 발생했다는 HTTP 상태 500과 SOAP 메시지가 표시됩니다. 감사.

  • 이전 vba - 새로운 엑셀 시트에 코드를 동적으로 추가
  • 다음 django - Django_tables2 row에서 정보를 얻는 방법?