저는 wget을 사용하여 webservice가 작동하는 방식을 더 잘 이해하기 위해 테스트하는 초보자입니다.wget, webservice 및 SOAP
내가 읽은 내용에서#!/bin/bash
REQUEST="<?xml version=\"1.0\" ?><S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns2=\"http://schema.thecompany.se/header/v1\" xmlns:ns3=\"http://messages.thecompany.se/theServicePath/theService/v1\"><S:Body><ns3:theRequest><ns2:identity>1234567</ns2:identity></ns3:theRequest></S:Body></S:Envelope>"
MY_FILE="/tmp/myfile.xml"
echo $REQUEST > $MY_FILE
/usr/bin/wget -O - --no-cache -dv --http-user="theDomain\theUser" --http-password="aPassword" \
--post-file=$MY_FILE \
--header="SOAPAction: \"http://xmlns.thecompany.com/path/theService/theRequest\"" \
--header="Content-Type: text/xml; charset=utf-8;" \
--auth-no-challenge \
--no-check-certificate \
https://service.thecompany.com/path/theServicePath/theService_v1.svc/basic
의의 SOAPAction 필드는 HTTP를 통해 SOAP 필수지만 이미 HTTP 요청 URI 때문에 ""할 수있다 : 순간
, 나는 bash는 스크립트는 다음과 같이 찾고 있습니다 SOAP 메시지의 의도를 제공합니다.
내가했던 것처럼 두 곳에서 URI를 제공하는 대신 SOAPAction : ""을 사용하는 것이 좋습니다.
SOAPAction이 완전히 지정되면 위의 코드가 잘못 되었습니까? SOAPAction URI는 HTTP 요청 URI와 동일해야합니까?
예에서 보았던 네임 스페이스 목록 (xmlns :)은 요청에서 사용중인 것보다 큽니다. 예 : 나는 종종 xmlns : ns3 = "http://schemas.microsoft.com/2003/10/Serialization/"을 보았지만 결코 요청에서 ns3을 사용하지 않았습니다. 왜 그렇게 된거야?
또한 스크립트를 작동시킬 수 없습니다. 요청이 게시 된 후 응답은 403 FORBIDDEN입니다.
스크립트의 문제점은 요청이 게시 될 때 응답이 403 FORBIDDEN입니다. 백 슬래시를 추가하는 것은 도움이되지 않습니다. 내 주요 관심사는 위의 질문에 대한 이해를 얻는 것입니다 :-) – buzztr