Webサービスを利用する際の注意制限事項について説明します。
<javaType name="java.util.Calendar" xmlType="xs:dateTime" parseMethod="javax.xml.bind.DatatypeConverter.parseDate" printMethod="javax.xml.bind.DatatypeConverter.printDate"/>
-Dcom.nec.webotx.webservice.tools.ws.Invoker.noSystemProxies=true
<operation name="someOperation"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> <fault name="someOperationFault"> <soap:fault name="someOperationFault" use="literal" /> </fault> </operation>
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@SOAPBinding(use=SOAPBinding.Use.LITERAL)
@WebService
public class ServerImpl {
:
}
Service service = ・・・; QName qname = ・・・; JAXBContext context = ・・・; Dispatch dispatch = service.createDispatch(qname, context, Service.Mode.PAYLOAD);
public class SomeHandler implements SOAPHandler <SOAPMessageContext> {
public boolean handleMessage(SOAPMessageContext context) {
:
:
return true; // 非同期通信で呼ばれるハンドラは必ずtrueを返すようにします
}
public boolean handleFault(SOAPMessageContext context) {
:
:
return true; // 非同期通信で呼ばれるハンドラは必ずtrueを返すようにします
}
}
<xs:complexType name="someOperation"> <xs:sequence> <xs:element name="arg0" type="xs:int"/> <xs:element name="arg1" type="xs:int"/> // bareだと同じパラメータは1回しか現れない </xs:sequence> </xs:complexType> <message name="someOperation"> <part name="parameters" element="tns:someOperation"/> // bareだとここでパラメータを複数指定する </message> <operation name="someOperation"> <input message="tns:someOperation"/> <output message="tns:someOperationResponse"/> </operation>
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
use=SOAPBinding.Use.LITERAL,
parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
@WebService
public class ServerImpl {
public int someOperation(int arg0, int arg1) {
:
:
}
}
注:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。 注:詳細については、-Xlint:unchecked オプションを指定して再コンパイルしてください。当該条件の場合、この警告について何ら対策を講じる必要はありません。この警告が出ていても、Javaコンパイル、wscompileコマンド、および配備処理は正常に動作しています。
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
...
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
</servlet>
...
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
...
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
</servlet>
...
</web-app>
grant codeBase "file:${com.nec.webotx.instanceRoot}/lib/-" {
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission org.osgi.framework.AdminPermission "*", "resource";
};
ポリシーファイルの設定は [ドメイン構築・基本設定ガイド > 3. ドメイン > 3.7. ポリシーファイルの設定] を参照ください。
特にありません。
特にありません。