<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n1="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style"> <wsdl:documentation> <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl"/> </wsdl:documentation> <wsdl:types> <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions"> ... </xsd:schema> <xsd:schema xmlns:n0="urn:sap-com:document:sap:rfc:functions" attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style"> <xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/> <xsd:complexType name="Zk2ReservationHeader"> <xsd:sequence> <xsd:element name="Plant" type="n0:char4"/> <xsd:element name="ResDate" type="n0:date10"/> <xsd:element name="MoveType" type="n0:char3"/> <xsd:element name="GrRcpt" type="n0:char12"/> <xsd:element name="CostCtr" type="n0:char10"/> <xsd:element name="AssetNo" type="n0:char12"/> <xsd:element name="SubNumber" type="n0:char4"/> <xsd:element name="OrderNo" type="n0:char12"/> <xsd:element name="MovePlant" type="n0:char4"/> <xsd:element name="MoveStloc" type="n0:char4"/> <xsd:element name="CreatedBy" type="n0:char12"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Bapireturn"> <xsd:sequence> <xsd:element name="Type" type="n0:char1"/> <xsd:element name="Code" type="n0:char5"/> <xsd:element name="Message" type="n0:char220"/> <xsd:element name="LogNo" type="n0:char20"/> <xsd:element name="LogMsgNo" type="n0:numeric6"/> <xsd:element name="MessageV1" type="n0:char50"/> <xsd:element name="MessageV2" type="n0:char50"/> <xsd:element name="MessageV3" type="n0:char50"/> <xsd:element name="MessageV4" type="n0:char50"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Zk2ReservationItems"> <xsd:sequence> <xsd:element name="MaterialLong" type="n0:char40"/> <xsd:element name="Plant" type="n0:char4"/> <xsd:element name="StoreLoc" type="n0:char4"/> <xsd:element name="Batch" type="n0:char10"/> <xsd:element name="Quantity" type="n0:quantum13.3"/> <xsd:element name="Unit" type="n0:unit3"/> <xsd:element name="ReqDate" type="n0:date10"/> <xsd:element name="ShortText" type="n0:char50"/> <xsd:element name="UnloadPt" type="n0:char25"/> <xsd:element name="FixedQuan" type="n0:char1"/> <xsd:element name="Movement" type="n0:char1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="TableOfBapireturn"> <xsd:sequence> <xsd:element name="item" type="tns:Bapireturn" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="TableOfZk2ReservationItems"> <xsd:sequence> <xsd:element name="item" type="tns:Zk2ReservationItems" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:element name="Zk2BapiIbReservation"> <xsd:complexType> <xsd:sequence> <xsd:element name="EtReturn" type="tns:TableOfBapireturn" minOccurs="0"/> <xsd:element name="IHeader" type="tns:Zk2ReservationHeader"/> <xsd:element name="It_Items" type="tns:TableOfZk2ReservationItems"/> <xsd:element name="Testrun" type="n0:char1" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Zk2BapiIbReservationResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="EReservation" type="n0:numeric10"/> <xsd:element name="EtReturn" type="tns:TableOfBapireturn" minOccurs="0"/> <xsd:element name="It_Items" type="tns:TableOfZk2ReservationItems"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="Zk2BapiIbReservation"> <wsdl:part name="parameters" element="tns:Zk2BapiIbReservation"/> </wsdl:message> <wsdl:message name="Zk2BapiIbReservationResponse"> <wsdl:part name="parameter" element="tns:Zk2BapiIbReservationResponse"/> </wsdl:message> <wsdl:portType name="Z_Create_Reservation"> <wsdl:operation name="Zk2BapiIbReservation"> <wsdl:input message="tns:Zk2BapiIbReservation"/> <wsdl:output message="tns:Zk2BapiIbReservationResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="Z_Create_Reservation_bln" type="tns:Z_Create_Reservation"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="Zk2BapiIbReservation"> <soap:operation soapAction="urn:sap-com:document:sap:soap:functions:mc-style:Z_Create_Reservation:Zk2BapiIbReservationRequest" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="Z_Create_Reservation_bln_soap12" type="tns:Z_Create_Reservation"> <wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="Zk2BapiIbReservation"> <wsoap12:operation soapAction="urn:sap-com:document:sap:soap:functions:mc-style:Z_Create_Reservation:Zk2BapiIbReservationRequest" style="document"/> <wsdl:input> <wsoap12:body use="literal"/> </wsdl:input> <wsdl:output> <wsoap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Z_Create_Reservation"> <wsdl:port name="Z_Create_Reservation_bln" binding="tns:Z_Create_Reservation_bln"> <soap:address location="http://test/z_create_reservation_bln"/> </wsdl:port> <wsdl:port name="Z_Create_Reservation_bln_soap12" binding="tns:Z_Create_Reservation_bln_soap12"> <wsoap12:address location="http:/test/z_create_reservation_bln"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
$wsdl = 'test?sap-client=200'; $SOAP_CONFIG = array( 'login' => 'test01', 'password' => '*******', 'authentication' => SOAP_AUTHENTICATION_BASIC, 'soap_version' => SOAP_1_1, 'connection_timeout' => 15, 'encoding' => 'UTF-8' ); $client = new \SoapClient($wsdl, $SOAP_CONFIG);
$client = new \SoapClient($wsdl, $SOAP_CONFIG); echo '<pre>'; var_dump($client->__getFunctions()); echo '</pre>'; $head = new \stdClass(); $head->Plant="1100"; $head->ResDate="2020-08-17"; $head->MoveType="241"; $head->GrRcpt="test"; $head->CostCtr="3191112"; $head->AssetNo="000099900001"; $head->SubNumber=""; $head->OrderNo=""; $head->MovePlant=""; $head->MoveStloc=""; $head->CreatedBy=""; $detail = new \stdClass(); $detail->MaterialLong = 'C21-MCAA151'; $detail->Plant = '2100'; $detail->StoreLoc = 'F131'; $detail->Batch = ''; $detail->Quantity = '5'; $detail->ReqDate = '2020-08-17'; $detail->Unit = 'ST'; $detail->ShortText = 'qweasd'; $detail->UnloadPt = ''; $detail->FixedQuan = '1'; $detail->Movement = '1'; $de[] = $detail; $detail = new \stdClass(); $detail->MaterialLong = 'C21-SWAA001'; $detail->Plant = '2100'; $detail->StoreLoc = 'F131'; $detail->Batch = ''; $detail->Quantity = '10.00'; $detail->ReqDate = '2020-08-17'; $detail->Unit = 'ST'; $detail->ShortText = 'qweasd'; $detail->UnloadPt = ''; $detail->FixedQuan = '1'; $detail->Movement = '1'; $de[] = $detail; $re = new \stdClass(); $re->item = ''; $main = new \stdClass(); $main->IHeader = $head; $main->It_Items = $de; $main->EtReturn = $re; $result = $client->Zk2BapiIbReservation($main);
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง